/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package ar.edu.utn.frsf.cidisi.ginet.abstractginet.impl;

import ar.edu.utn.frsf.cidisi.ginet.abstractginet.AbstractginetPackage;
import ar.edu.utn.frsf.cidisi.ginet.abstractginet.RefPlace;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Ref Place</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ar.edu.utn.frsf.cidisi.ginet.abstractginet.impl.RefPlaceImpl#getParallelCardinality <em>Parallel Cardinality</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class RefPlaceImpl extends org.pnml.tools.epnk.pnmlcoremodel.impl.RefPlaceImpl implements RefPlace {
	/**
	 * The default value of the '{@link #getParallelCardinality() <em>Parallel Cardinality</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getParallelCardinality()
	 * @generated
	 * @ordered
	 */
	protected static final String PARALLEL_CARDINALITY_EDEFAULT = "1";

	/**
	 * The cached value of the '{@link #getParallelCardinality() <em>Parallel Cardinality</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getParallelCardinality()
	 * @generated
	 * @ordered
	 */
	protected String parallelCardinality = PARALLEL_CARDINALITY_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected RefPlaceImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return AbstractginetPackage.Literals.REF_PLACE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getParallelCardinality() {
		return parallelCardinality;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setParallelCardinality(String newParallelCardinality) {
		String oldParallelCardinality = parallelCardinality;
		parallelCardinality = newParallelCardinality;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, AbstractginetPackage.REF_PLACE__PARALLEL_CARDINALITY, oldParallelCardinality, parallelCardinality));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case AbstractginetPackage.REF_PLACE__PARALLEL_CARDINALITY:
				return getParallelCardinality();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case AbstractginetPackage.REF_PLACE__PARALLEL_CARDINALITY:
				setParallelCardinality((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case AbstractginetPackage.REF_PLACE__PARALLEL_CARDINALITY:
				setParallelCardinality(PARALLEL_CARDINALITY_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case AbstractginetPackage.REF_PLACE__PARALLEL_CARDINALITY:
				return PARALLEL_CARDINALITY_EDEFAULT == null ? parallelCardinality != null : !PARALLEL_CARDINALITY_EDEFAULT.equals(parallelCardinality);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (parallelCardinality: ");
		result.append(parallelCardinality);
		result.append(')');
		return result.toString();
	}

} //RefPlaceImpl
